package com.opennews.openplatform.familyexpenseapi.controller

import com.opennews.openplatform.myspringbootcore.dto.ApiResponse
import com.opennews.openplatform.myspringbootcore.util.getSuccessResponse
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * This is used by the upload package.
 * We need to check and refresh the token if it can.
 * Remember to set this url as isFullyAuthenticated() in spring security rest.
 * We are making an HTTP GET request to this URL before upload.
 */
@RestController
@RequestMapping("/token-check")
class TokenCheckController {
    @GetMapping
    fun index(): ResponseEntity<ApiResponse<Any?>> {
        return getSuccessResponse()
    }
}